<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Symbol 创建对象属性</title>
</head>
<body>
	
	<script>
		// 实现方式 1
		let game = {
			name: "俄罗斯方块",
			up: function(){
				console.log('俄罗斯方块，Up');
			},
			down: function(){
				console.log('俄罗斯方块，Down');
			}
		};

		let methods = {
			up: Symbol(),
			down: Symbol()
		};

		game[methods.up] = function(){
			console.log('up, function');
		}

		game[methods.down] = function(){
			console.log('down, function');
		}

		console.log(game);

		// 实现方式 2
		let youxi = {
			name: "狼人杀",
			[Symbol('say')]: function(){
				console.log('我能发言。');
			},
			[Symbol("zibao")]: function(){
				console.log('我能自爆！！');
			}
		}

		console.log(youxi);
	</script>
</body>
</html>